<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body class="timo-layout-page">
    <div class="layui-card">
        <div class="layui-card-header timo-card-header">
            <span><i class="fa fa-bars"></i> 信息管理</span>
            <i class="layui-icon layui-icon-refresh refresh-btn"></i>
        </div>
        <div class="layui-card-body">
            <div class="layui-row timo-card-screen">
                <div class="pull-left layui-form-pane timo-search-box">
                   <!-- <div class="layui-inline">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block timo-search-status">
                            <select class="timo-search-select" name="status" mo:dict="SEARCH_STATUS" mo-selected="${param.status}"></select>
                        </div>
                    </div>  -->
                    <div class="layui-inline">
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-block timo-search-status" style="width: 120px;">
                    
                    <select class="timo-search-select" name="message_type2" style="width: 120px;"> 
				    <option value="">分类</option>
				    <option th:each="category: ${typelist}"
				            th:text="${category.title}"
				            th:value="${category.id}"
				            th:selected="${category.id == message_type2}"
				            th:name="${category.title}">
   					 </option>
				</select>
				</div>
				</div>
				 <div class="layui-inline">
                        <label class="layui-form-label">置顶状态</label>
                        <div class="layui-input-block timo-search-status" style="width: 120px;">
                        <select class="timo-search-select" name="istop" style="width: 120px;"> 
				    		<option value="">全部</option>
				    		<option value="0">普通</option>
				    		<option value="1">置顶</option>
				    
				        </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" th:value="${param.title}" placeholder="请输入标题" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn timo-search-btn">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>
                </div>
                <div class="pull-right screen-btn-group">
                    <!--  <button class="layui-btn open-popup" data-title="添加帖子管理" th:attr="data-url=@{/message/messageInfo/add}" data-size="auto">
                        <i class="fa fa-plus"></i> 添加</button>-->
                   <div class="btn-group">
                        <button class="layui-btn">操作<span class="caret"></span></button>
                        <dl class="layui-nav-child layui-anim layui-anim-upbit">
                           <!--  <dd><a class="ajax-status" th:href="@{/message/messageInfo/status/ok}">启用</a></dd>
                            <dd><a class="ajax-status" th:href="@{/message/messageInfo/status/freezed}">冻结</a></dd>
                            --> <dd><a class="ajax-status" th:href="@{/message/messageInfo/status/delete}">删除</a></dd>
                        </dl>
                    </div> 
                </div>
            </div>
            <div class="timo-table-wrap">
                <table class="layui-table timo-table">
                    <thead>
                    <tr>
                        <th class="timo-table-checkbox">
                            <label class="timo-checkbox"><input type="checkbox">
                                <i class="layui-icon layui-icon-ok"></i></label>
                        </th>
                        <th>主键ID</th>
                        <th>标题</th>
                        <th>所属类别</th>
                        <th>发布人</th>
                        <th>手机号</th>
                        <th>所属城市</th>
                        <th>置顶</th>
                        <th>支付状态</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="item:${list}">
                        <td><label class="timo-checkbox"><input type="checkbox" th:value="${item.id}">
                            <i class="layui-icon layui-icon-ok"></i></label></td>
                        <td th:text="${item.id}">主键ID</td>
                        <td th:text="${#strings.abbreviate(item.title,15)}">标题</td>
                        <td th:text="${item?.typeone?.title}">所属类别</td>
                        <td th:text="${item?.pushName}">发布人</td>
                        <td th:text="${item?.pushPhone}">手机号</td>
                        <td th:text="${item.areaname}">城市</td>
                        <td th:switch="${item.istop}" >
                           <span th:case="0">否</span>
                           <span th:case="1">置顶</span></td>
                        <td th:switch="${item.payStatus}">
                            <span th:case="0">未支付</span>
                            <span th:case="1">已支付</span></td>
                        <td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>
                        <td>
                         <!--    <a class="open-popup" data-title="编辑帖子管理" th:attr="data-url=@{'/message/messageInfo/edit/'+${item.id}}" data-size="auto" href="#">编辑</a>
                          -->   <a class="open-popup" data-title="详细信息" th:attr="data-url=@{'/message/messageInfo/detail/'+${item.id}}" data-size="max" href="#">详细</a>
                            <a class="open-popup" data-title="编辑信息" th:attr="data-url=@{'/message/messageInfo/selectEdit/'+${item.id}}" data-size="max" href="#">编辑</a>
                            <a class="ajax-get" data-msg="您是否确认删除" th:href="@{/message/messageInfo/status/delete(ids=${item.id})}">删除</a>
                            <a class="open-popup" data-title="下架操作" th:attr="data-url=@{'/message/messageInfo/refundRedirect/'+${item.id}}" data-size="max" href="#">下架</a>

                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div th:replace="/common/fragment :: page"></div>
        </div>
    </div>
<script th:replace="/common/template :: script"></script>
</body>
</html>